{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "import unicodedata\n",
    "import re\n",
    "import os\n",
    "import json\n",
    "from tqdm import tqdm\n",
    "import random\n",
    "from pprint import pprint"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_home = \"../ori_data\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# WebNLG"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_dir = os.path.join(data_home, \"webnlg\")\n",
    "train_data_path = os.path.join(data_dir, \"train_data.json\")\n",
    "valid_data_path = os.path.join(data_dir, \"valid_data.json\")\n",
    "test_data_path = os.path.join(data_dir, \"test_data\", \"test.json\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_data = json.load(open(train_data_path, \"r\", encoding = \"utf-8\"))\n",
    "valid_data = json.load(open(valid_data_path, \"r\", encoding = \"utf-8\"))\n",
    "test_data = json.load(open(test_data_path, \"r\", encoding = \"utf-8\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Verona , Italy is the home to A.C. Chievo Verona which has 39371 members and the full name of `` Associazione Calcio ChievoVerona S.r.l . `` .\n",
      "[['A.C. Chievo Verona',\n",
      "  'fullname',\n",
      "  '`` Associazione Calcio ChievoVerona S.r.l . ``'],\n",
      " ['A.C. Chievo Verona', 'ground', '``'],\n",
      " ['A.C. Chievo Verona', 'numberOfMembers', '39371']]\n",
      "A.D. Isidro Metapan 's full name is `` Asociación Deportiva '' . They have 10000 members and their ground is in Metapan , El Salvador .\n",
      "[['A.D. Isidro', 'ground', '``'],\n",
      " ['A.D. Isidro', 'numberOfMembers', '10000'],\n",
      " ['A.D. Isidro', 'fullname', \"`` Asociación Deportiva ''\"]]\n",
      "A.F.C . Blackpool fullname is `` Association Football Club Blackpool , '' they have 1500 members and their grounds are at Jespon Way .\n",
      "[['A.F.C . Blackpool', 'ground', '``'],\n",
      " ['A.F.C . Blackpool', 'numberOfMembers', '1500'],\n",
      " ['A.F.C . Blackpool', 'fullname', '`` Association Football Club Blackpool']]\n",
      "A.F.C . Blackpool fullname is `` Association Football Club Blackpool '' . They have 1500 members and their ground is The Mechanics .\n",
      "[['A.F.C . Blackpool', 'ground', '``'],\n",
      " ['A.F.C . Blackpool', 'numberOfMembers', '1500'],\n",
      " ['A.F.C . Blackpool', 'fullname', \"`` Association Football Club Blackpool ''\"]]\n",
      "A.F.C . Fylde 's ground is Kellamergh Park . They have 3180 members and the full name of `` Association Football Club Fylde . `` .\n",
      "[['A.F.C . Fylde', 'ground', '``'],\n",
      " ['A.F.C . Fylde', 'numberOfMembers', '3180'],\n",
      " ['A.F.C . Fylde', 'fullname', '`` Association Football Club Fylde']]\n",
      "The full name of the A.F.C . Fylde is `` Association Football Club Fylde '' they are based at Bryning Lane and have 3180 members .\n",
      "[['A.F.C . Fylde', 'numberOfMembers', '3180'],\n",
      " ['A.F.C . Fylde', 'fullname', \"`` Association Football Club Fylde ''\"],\n",
      " ['A.F.C . Fylde', 'ground', '``']]\n",
      "The nickname of Agremiação Sportiva Arapiraquense is `` Alvinegro '' , they played in 2015 and they have 17,000 members .\n",
      "[['Agremiação Sportiva Arapiraquense', 'nickname', '``'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'season', '2015']]\n",
      "Ayam penyet is a food found in Java and can be found nationwide and also in Malaysia and Singapore . `` Squeezed '' or `` smashed '' fried chicken served with sambal is a main ingredient in ayam penyet .\n",
      "[['Ayam penyet', 'region', '``'],\n",
      " ['Ayam penyet', 'country', 'Java'],\n",
      " ['Ayam penyet',\n",
      "  'mainIngredients',\n",
      "  \"`` Squeezed '' or `` smashed '' fried chicken served with sambal\"]]\n",
      "Ayam penyet is from Indonesia and can be found nationwide and also in Malaysia and Singapore . The main ingredients of Ayam penyet are `` squeezed '' or `` smashed '' chicken served with sambal .\n",
      "[['Ayam penyet', 'region', '``'],\n",
      " ['Ayam penyet', 'mainIngredients', '``'],\n",
      " ['Ayam penyet', 'country', 'Indonesia']]\n",
      "Ayam penyet is from Indonesia and can be found nationwide and also in Malaysia and Singapore . The main ingredients of Ayam penyet are `` squeezed '' or `` smashed '' chicken served with sambal .\n",
      "[['Ayam penyet', 'region', '``'],\n",
      " ['Ayam penyet', 'mainIngredients', '``'],\n",
      " ['Ayam penyet', 'country', 'Indonesia']]\n",
      "Ayam penyet is a dish from the region of Singapore as well as from Java . The main ingredients of Ayam penyet are `` squeezed '' or `` smashed '' chicken served with sambal .\n",
      "[['Ayam penyet', 'region', 'Singapore'],\n",
      " ['Ayam penyet', 'country', 'Java'],\n",
      " ['Ayam penyet', 'mainIngredients', '``']]\n",
      "1634 : The Bavarian Crisis written by Virginia DeMarce is available in print form and can be located by it 's ISBN number `` 978-1-4165-4253-7 '' .\n",
      "[['1634 : The Bavarian Crisis', 'ISBN_number', \"`` 978-1-4165-4253-7 ''\"],\n",
      " ['1634 : The Bavarian Crisis', 'mediaType', '``'],\n",
      " ['1634 : The Bavarian Crisis', 'author', 'Virginia DeMarce']]\n",
      "1634 : The Bavarian Crisis can be located by it 's ISBN number `` 978-1-4165-4253-7 '' , its author is Eric Flint and was put in print .\n",
      "[['1634 : The Bavarian Crisis', 'author', 'Eric Flint'],\n",
      " ['1634 : The Bavarian Crisis', 'ISBN_number', \"`` 978-1-4165-4253-7 ''\"],\n",
      " ['1634 : The Bavarian Crisis', 'mediaType', '``']]\n",
      "`` 1634 ; The Ram Rebellion '' by Eric Flint is available in paperback with an ISBN number of 1-4165-2060-0 .\n",
      "[['1634', 'author', 'Eric Flint'], ['1634', 'ISBN_number', '``']]\n",
      "Eric Flint wrote the book `` 1634 : The Ram Rebellion '' which is available in paperback and has 512 pages .\n",
      "[['1634 : The Ram Rebellion', 'author', 'Eric Flint'],\n",
      " ['1634 : The Ram Rebellion', 'numberOfPages', '``']]\n",
      "The abbreviation `` ACM Trans . Inf . Syst . '' is for ACM Transactions on Information Systems , which has the ISSN number 1558-2868 and the LCCN number 89646863 .\n",
      "[['ACM Transactions on Information Systems', 'ISSN_number', '``'],\n",
      " ['ACM Transactions on Information Systems', 'LCCN_number', '89646863'],\n",
      " ['ACM Transactions on Information Systems',\n",
      "  'abbreviation',\n",
      "  '`` ACM Trans . Inf . Syst .']]\n",
      "89646863 is the LCCN number of ACM Transactions on Information Systems and its ISSN number is 1046-8188 . `` ACM Trans . Inf . Syst . '' is its abreviation .\n",
      "[['ACM Transactions on Information Systems',\n",
      "  'abbreviation',\n",
      "  '`` ACM Trans . Inf . Syst .'],\n",
      " ['ACM Transactions on Information Systems', 'LCCN_number', '89646863'],\n",
      " ['ACM Transactions on Information Systems', 'ISSN_number', '``']]\n",
      "The book `` A Fortress of Grey Ice '' by J V Jones can be found in print and the OCLC number 51969173 .\n",
      "[['A Fortress of Grey Ice', 'OCLC_number', '51969173'],\n",
      " ['A Fortress of Grey Ice', 'mediaType', '``']]\n",
      "The book `` A Fortress of Grey Ice '' was written by J V Jones , can be found in print and has 672 pages .\n",
      "[['A Fortress of Grey Ice', 'numberOfPages', '``'],\n",
      " ['A Fortress of Grey Ice', 'mediaType', '``']]\n",
      "The book `` A Fortress of Grey Ice '' was written by J V Jones , can be found in print and has 672 pages .\n",
      "[['A Fortress of Grey Ice', 'numberOfPages', '``'],\n",
      " ['A Fortress of Grey Ice', 'mediaType', '``']]\n",
      "Diane Duane wrote A Wizard of Mars which is available in print and has the ISBN number `` 978-0-15-204770-2 '' .\n",
      "[['A Wizard of Mars', 'author', 'Diane Duane'],\n",
      " ['A Wizard of Mars', 'mediaType', '``'],\n",
      " ['A Wizard of Mars', 'ISBN_number', \"`` 978-0-15-204770-2 ''\"]]\n",
      "Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg ( or Abh . Math . Semin . Univ . Hambg . ) Has an ISSN number of `` 0025-5858 '' and LCCN number of 32024459 .\n",
      "[['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'ISSN_number',\n",
      "  \"`` 0025-5858 ''\"],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'LCCN_number',\n",
      "  '32024459'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'abbreviation',\n",
      "  '``']]\n",
      "The book `` Alcatraz Versus the Evil Librarians '' is printed with 320 pages and has an ISBN number of 0-439-92550-9 .\n",
      "[['Alcatraz Versus the Evil Librarians', 'numberOfPages', '``'],\n",
      " ['Alcatraz Versus the Evil Librarians', 'mediaType', '``'],\n",
      " ['Alcatraz Versus the Evil Librarians', 'ISBN_number', '``']]\n",
      "The book `` Alcatraz Versus the Evil Librarians '' is printed with 320 pages and has an ISBN number of 0-439-92550-9 .\n",
      "[['Alcatraz Versus the Evil Librarians', 'numberOfPages', '``'],\n",
      " ['Alcatraz Versus the Evil Librarians', 'mediaType', '``'],\n",
      " ['Alcatraz Versus the Evil Librarians', 'ISBN_number', '``']]\n",
      "The book `` Alcatraz Versus the Evil Librarians '' is printed with 320 pages and has an ISBN number of 0-439-92550-9 .\n",
      "[['Alcatraz Versus the Evil Librarians', 'numberOfPages', '``'],\n",
      " ['Alcatraz Versus the Evil Librarians', 'mediaType', '``'],\n",
      " ['Alcatraz Versus the Evil Librarians', 'ISBN_number', '``']]\n",
      "The American Journal of Mathematics was first published in 1878 and is abbreviated to Am . J . Math . It has the ISSN number `` 0002-9327 '' .\n",
      "[['American Journal of Mathematics', 'abbreviation', '``'],\n",
      " ['American Journal of Mathematics', 'firstPublicationYear', '1878'],\n",
      " ['American Journal of Mathematics', 'ISSN_number', \"`` 0002-9327 ''\"]]\n",
      "The nickname of the 1 Decembrie 1918 University is Uab . The latin name is `` Universitas Apulensis '' and the rector is Breaz Valer Daniel .\n",
      "[['1 Decembrie 1918 University', 'nickname', 'Uab'],\n",
      " ['1 Decembrie 1918 University', 'rector', '``'],\n",
      " ['1 Decembrie 1918 University', 'latinName', \"`` Universitas Apulensis ''\"]]\n",
      "Acharya Institute of Technology has an academic staff of 500 . It is located in India and its motto is `` Nurturing Excellence '' .\n",
      "[['Acharya Institute of Technology', 'academicStaffSize', '``'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``']]\n",
      "Acharya Institute of Technology has an academic staff of 500 . It is located in India and its motto is `` Nurturing Excellence '' .\n",
      "[['Acharya Institute of Technology', 'academicStaffSize', '``'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``']]\n",
      "Adisham Hall , located in Hautale , Sri Lanka , is in the architectural style of `` Tudor and Jacobean '' and was completed in 1931 .\n",
      "[['Adisham Hall', 'architecturalStyle', '`` Tudor and'],\n",
      " ['Adisham Hall', 'location', '``'],\n",
      " ['Adisham Hall', 'completionDate', '1931']]\n",
      "Asilomar Conference Grounds , constructed in 1923 and located on Asilomar Blvd in Pacific Grove , California , is designed based on the architecture style of `` Arts and Crafts Movement and American craftsman Bungalows '' .\n",
      "[['Asilomar Conference Grounds', 'location', '``'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'architecture',\n",
      "  \"`` Arts and Crafts Movement and American craftsman Bungalows ''\"]]\n",
      "In the year 2000 the Acharya Institute of Technology was established in the state of Karnataka , India . The current campus address is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Director is Dr G P Prabhukumar and it is affiliated with the Visvesvaraya Technological University .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "In the year 2000 the Acharya Institute of Technology was established in the state of Karnataka , India . The current campus address is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Director is Dr G P Prabhukumar and it is affiliated with the Visvesvaraya Technological University .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "The location of the campus of the Acharya Institute of Technology in the state of Karnataka , India is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Institute , which has 700 postgraduate students , is affiliated with the Visvesvaraya Technological University and the Director is Dr G P Prabhukumar .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'numberOfPostgraduateStudents', '700'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "The location of the campus of the Acharya Institute of Technology in the state of Karnataka , India is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Institute , which has 700 postgraduate students , is affiliated with the Visvesvaraya Technological University and the Director is Dr G P Prabhukumar .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'numberOfPostgraduateStudents', '700'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "The location of the Acharya Institute of Technology is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Institute was established in 2000 in the state of Karnataka , India and has the motto `` Nurturing Excellence . It is affiliated with the Visvesvaraya Technological University .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'motto', '`` Nurturing Excellence'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "In 1928 the School of Business and Social Sciences at the Aarhus University in Denmark was established . The current Dean is Thomas Pallesen and there are 16000 students and 737 academic staff . It is affiliated with the European University Association and has the latin name of `` Universitas Aarhusiensis '' .\n",
      "[['School of Business and Social Sciences at the Aarhus University',\n",
      "  'academicStaffSize',\n",
      "  '737'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'dean',\n",
      "  '``'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'numberOfStudents',\n",
      "  '16000'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'country',\n",
      "  'Denmark'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'latinName',\n",
      "  \"`` Universitas Aarhusiensis ''\"],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'affiliation',\n",
      "  'European University Association'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'established',\n",
      "  '1928']]\n",
      "In 1928 the School of Business and Social Sciences at the Aarhus University was established in the city of Aarhus , Denmark . Dean Thomas Pallesen heads the School which has the Latin name of `` Universitas Aarhusiensis '' . There are 737 academic staff and it is affiliated with the European University Association .\n",
      "[['School of Business and Social Sciences at the Aarhus University',\n",
      "  'city',\n",
      "  'Aarhus'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'academicStaffSize',\n",
      "  '737'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'dean',\n",
      "  '``'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'country',\n",
      "  'Denmark'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'latinName',\n",
      "  \"`` Universitas Aarhusiensis ''\"],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'affiliation',\n",
      "  'European University Association'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'established',\n",
      "  '1928']]\n",
      "The Dean of the School of Business and Social Sciences at the Aarhus University in the city of Aarhus is Thomas Pallesen . The School was established in 1928 and is affiliated with the European University Association . The latin name for the School is `` Universitas Aarhusiensis '' and there are 737 academic staff and 16000 students .\n",
      "[['School of Business and Social Sciences at the Aarhus University',\n",
      "  'city',\n",
      "  'Aarhus'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'dean',\n",
      "  '``'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'numberOfStudents',\n",
      "  '16000'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'academicStaffSize',\n",
      "  '737'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'latinName',\n",
      "  \"`` Universitas Aarhusiensis ''\"],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'affiliation',\n",
      "  'European University Association'],\n",
      " ['School of Business and Social Sciences at the Aarhus University',\n",
      "  'established',\n",
      "  '1928']]\n",
      "The campus address of the Acharya Institute of Technology in India is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Director of the Institute which was established in 2000 is Dr G P Prabhukumar and there are 700 postgraduate students . The Institute is affiliated with the Visvesvaraya Technological University in the city of Belgaum .\n",
      "[['Visvesvaraya Technological University', 'city', 'Belgaum'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'numberOfPostgraduateStudents', '700'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "The campus address of the Acharya Institute of Technology in India is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Director of the Institute which was established in 2000 is Dr G P Prabhukumar and there are 700 postgraduate students . The Institute is affiliated with the Visvesvaraya Technological University in the city of Belgaum .\n",
      "[['Visvesvaraya Technological University', 'city', 'Belgaum'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'numberOfPostgraduateStudents', '700'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "Baku Turkish Martyrs ' Memorial , made from red granite and white marble , is dedicated to the Ottoman Army soldiers killed in the Battle of Baku , Azerbaijan . The memorial ( native name `` Türk Sehitleri Aniti '' ) was designed by Huseyin Butuner and Hilmi Guner . Artur Rasizade is the leader ( official title President ) of Azerbaijan .\n",
      "[['Azerbaijan', 'leader', 'Artur Rasizade'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'material', '``'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'dedicatedTo', '``'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'location', 'Azerbaijan'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'nativeName', '`` Türk'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'designer', '``']]\n",
      "Baku Turkish Martyrs ' Memorial , made from red granite and white marble , is dedicated to the Ottoman Army soldiers killed in the Battle of Baku , Azerbaijan . The memorial ( native name `` Türk Sehitleri Aniti '' ) was designed by Huseyin Butuner and Hilmi Guner . Artur Rasizade is the leader ( official title President ) of Azerbaijan .\n",
      "[['Azerbaijan', 'leader', 'Artur Rasizade'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'material', '``'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'dedicatedTo', '``'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'location', 'Azerbaijan'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'nativeName', '`` Türk'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'designer', '``']]\n",
      "Baku Turkish Martyrs ' Memorial , made from red granite and white marble , is dedicated to the Ottoman Army soldiers killed in the Battle of Baku , Azerbaijan . The memorial ( native name `` Türk Sehitleri Aniti '' ) was designed by Huseyin Butuner and Hilmi Guner . Artur Rasizade is the leader ( official title President ) of Azerbaijan .\n",
      "[['Azerbaijan', 'leader', 'Artur Rasizade'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'material', '``'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'dedicatedTo', '``'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'location', 'Azerbaijan'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'nativeName', '`` Türk'],\n",
      " [\"Baku Turkish Martyrs ' Memorial\", 'designer', '``']]\n",
      "Eric Flint wrote the book `` 1634 : The Ram Rebellion '' and is 512 pages long . It can be found in hardcover and has the ISBN number 1-4165-2060-0 .\n",
      "[['1634 : The Ram Rebellion', 'author', 'Eric Flint'],\n",
      " ['1634 : The Ram Rebellion', 'numberOfPages', '``'],\n",
      " ['1634 : The Ram Rebellion', 'ISBN_number', '``']]\n",
      "Eric Flint wrote the book `` 1634 : The Ram Rebellion '' and is 512 pages long . It can be found in hardcover and has the ISBN number 1-4165-2060-0 .\n",
      "[['1634 : The Ram Rebellion', 'author', 'Eric Flint'],\n",
      " ['1634 : The Ram Rebellion', 'numberOfPages', '``'],\n",
      " ['1634 : The Ram Rebellion', 'ISBN_number', '``']]\n",
      "ACM Transactions on Information Systems ( abbreviation : ACM Trans . Inf . Syst . ) has the LCCN number 89646863 and the ISSN number 1558-2868 . The CODEN code for ACM Transactions on Information Systems is `` ATISET '' .\n",
      "[['ACM Transactions on Information Systems', 'ISSN_number', '``'],\n",
      " ['ACM Transactions on Information Systems', 'LCCN_number', '89646863'],\n",
      " ['ACM Transactions on Information Systems', 'abbreviation', '``'],\n",
      " ['ACM Transactions on Information Systems', 'CODEN_code', \"`` ATISET ''\"]]\n",
      "ACM Transactions on Information Systems ( abbreviation : ACM Trans . Inf . Syst . ) has the LCCN number 89646863 and the ISSN number 1558-2868 . The CODEN code for ACM Transactions on Information Systems is `` ATISET '' .\n",
      "[['ACM Transactions on Information Systems', 'ISSN_number', '``'],\n",
      " ['ACM Transactions on Information Systems', 'LCCN_number', '89646863'],\n",
      " ['ACM Transactions on Information Systems', 'abbreviation', '``'],\n",
      " ['ACM Transactions on Information Systems', 'CODEN_code', \"`` ATISET ''\"]]\n",
      "`` Abh.Math.Semin.Univ.Hambg '' is the abbreviation for Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg . Their ISSN number is 0025-5858 , their LCCN number is 32024459 and their CODEN code is AMHAAJ .\n",
      "[['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'ISSN_number',\n",
      "  '``'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'LCCN_number',\n",
      "  '32024459'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'abbreviation',\n",
      "  '``'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'CODEN_code',\n",
      "  '``']]\n",
      "`` Abh.Math.Semin.Univ.Hambg '' is the abbreviation for Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg . Their ISSN number is 0025-5858 , their LCCN number is 32024459 and their CODEN code is AMHAAJ .\n",
      "[['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'ISSN_number',\n",
      "  '``'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'LCCN_number',\n",
      "  '32024459'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'abbreviation',\n",
      "  '``'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'CODEN_code',\n",
      "  '``']]\n",
      "`` Abh.Math.Semin.Univ.Hambg '' is the abbreviation for Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg . Their ISSN number is 0025-5858 , their LCCN number is 32024459 and their CODEN code is AMHAAJ .\n",
      "[['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'ISSN_number',\n",
      "  '``'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'LCCN_number',\n",
      "  '32024459'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'abbreviation',\n",
      "  '``'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'CODEN_code',\n",
      "  '``']]\n",
      "The Acta Mathematica Hungarica ( abbrv . Acta Math . Hungar ) has the CODEN code `` AMAHE9 '' . It 's ISSN and LCCN numbers are 0236-5294 and 83646315 respectively .\n",
      "[['Acta Mathematica Hungarica', 'ISSN_number', '``'],\n",
      " ['Acta Mathematica Hungarica', 'LCCN_number', '83646315'],\n",
      " ['Acta Mathematica Hungarica', 'abbreviation', '``'],\n",
      " ['Acta Mathematica Hungarica', 'CODEN_code', \"`` AMAHE9 ''\"]]\n",
      "The Acta Mathematica Hungarica ( abbrv . Acta Math . Hungar ) has the CODEN code `` AMAHE9 '' . It 's ISSN and LCCN numbers are 0236-5294 and 83646315 respectively .\n",
      "[['Acta Mathematica Hungarica', 'ISSN_number', '``'],\n",
      " ['Acta Mathematica Hungarica', 'LCCN_number', '83646315'],\n",
      " ['Acta Mathematica Hungarica', 'abbreviation', '``'],\n",
      " ['Acta Mathematica Hungarica', 'CODEN_code', \"`` AMAHE9 ''\"]]\n",
      "Acta Mathematica Hungarica is abbreviated as `` Acta Math . Hungar '' . The ISSN # is : 1588-2632 ; LCCN # : 83646315 and code AMAHE9 .\n",
      "[['Acta Mathematica Hungarica', 'ISSN_number', '``'],\n",
      " ['Acta Mathematica Hungarica', 'LCCN_number', '83646315'],\n",
      " ['Acta Mathematica Hungarica', 'abbreviation', '`` Acta Math . Hungar'],\n",
      " ['Acta Mathematica Hungarica', 'CODEN_code', '``']]\n",
      "Acta Mathematica Hungarica is abbreviated as `` Acta Math . Hungar '' . The ISSN # is : 1588-2632 ; LCCN # : 83646315 and code AMAHE9 .\n",
      "[['Acta Mathematica Hungarica', 'ISSN_number', '``'],\n",
      " ['Acta Mathematica Hungarica', 'LCCN_number', '83646315'],\n",
      " ['Acta Mathematica Hungarica', 'abbreviation', '`` Acta Math . Hungar'],\n",
      " ['Acta Mathematica Hungarica', 'CODEN_code', '``']]\n",
      "83646315 is the LCCN number for Acta Mathematica Hungarica and the ISSN number is 1588-2632 . Its bbreviation is `` Acta Math . Hungar . '' and its discipline is Math .\n",
      "[['Acta Mathematica Hungarica', 'LCCN_number', '83646315'],\n",
      " ['Acta Mathematica Hungarica', 'abbreviation', '`` Acta Math . Hungar .'],\n",
      " ['Acta Mathematica Hungarica', 'ISSN_number', '``']]\n",
      "Acta Palaeontologica Polonica , ISSN number is `` 0567-7920 '' , LCCN number of 60040714 , was published by the Polish Academy of Sciences and is known as Acta Palaeontol . Pol .\n",
      "[['Acta Palaeontologica Polonica', 'publisher', 'Polish Academy of Sciences'],\n",
      " ['Acta Palaeontologica Polonica', 'ISSN_number', \"`` 0567-7920 ''\"],\n",
      " ['Acta Palaeontologica Polonica', 'LCCN_number', '60040714'],\n",
      " ['Acta Palaeontologica Polonica', 'abbreviation', '``']]\n",
      "Acta Palaeontologica Polonica was published by the Polish Academy of Sciences and is abbreviated Acta Palaeontol . Pol . . The CODEN code is `` APGPAC '' and the LCCN number is 60040714 .\n",
      "[['Acta Palaeontologica Polonica', 'publisher', 'Polish Academy of Sciences'],\n",
      " ['Acta Palaeontologica Polonica', 'LCCN_number', '60040714'],\n",
      " ['Acta Palaeontologica Polonica', 'abbreviation', '``'],\n",
      " ['Acta Palaeontologica Polonica', 'CODEN_code', \"`` APGPAC ''\"]]\n",
      "The Addiction journal is published by Wiley-Blackwell on behalf of the Society for the Study of Addiction and has the ISSN number 1360-0443 . It has the abbreviation of `` Addiction '' and the LCCN number 93645978 .\n",
      "[['Addiction', 'ISSN_number', '``'],\n",
      " ['Addiction', 'LCCN_number', '93645978'],\n",
      " ['Addiction', 'abbreviation', \"`` Addiction ''\"],\n",
      " ['Addiction', 'publisher', '``']]\n",
      "The Addiction journal is published by Wiley-Blackwell on behalf of the Society for the Study of Addiction and has the ISSN number 1360-0443 . It has the abbreviation of `` Addiction '' and the LCCN number 93645978 .\n",
      "[['Addiction', 'ISSN_number', '``'],\n",
      " ['Addiction', 'LCCN_number', '93645978'],\n",
      " ['Addiction', 'abbreviation', \"`` Addiction ''\"],\n",
      " ['Addiction', 'publisher', '``']]\n",
      "Administrative Science Quarterly is published by SAGE Publications for the Samuel Curtis Johnson Graduate School of Management , Cornell University . It is abbreviated to Admin . Sci . Q . Its ISSN number is `` 0001-8392 '' and LLCN number is 57059226 .\n",
      "[['Administrative Science Quarterly', 'abbreviation', '``'],\n",
      " ['Administrative Science Quarterly', 'ISSN_number', \"`` 0001-8392 ''\"],\n",
      " ['Administrative Science Quarterly', 'LCCN_number', '57059226'],\n",
      " ['Administrative Science Quarterly', 'publisher', '``']]\n",
      "Administrative Science Quarterly is published by SAGE Publications for the Samuel Curtis Johnson Graduate School of Management , Cornell University . It is abbreviated to Admin . Sci . Q . Its ISSN number is `` 0001-8392 '' and LLCN number is 57059226 .\n",
      "[['Administrative Science Quarterly', 'abbreviation', '``'],\n",
      " ['Administrative Science Quarterly', 'ISSN_number', \"`` 0001-8392 ''\"],\n",
      " ['Administrative Science Quarterly', 'LCCN_number', '57059226'],\n",
      " ['Administrative Science Quarterly', 'publisher', '``']]\n",
      "Administrative Science Quarterly was published by Cornell University and has the abbreviation of Admin . Sci . Q. . It has the ISSN number `` 0001-8392 '' and the LCCN number of 57059226 .\n",
      "[['Administrative Science Quarterly', 'publisher', 'Cornell University'],\n",
      " ['Administrative Science Quarterly', 'abbreviation', '``'],\n",
      " ['Administrative Science Quarterly', 'ISSN_number', \"`` 0001-8392 ''\"],\n",
      " ['Administrative Science Quarterly', 'LCCN_number', '57059226']]\n",
      "The American Journal of Mathematics was first published in 1878 and is also known by the abbreviated title of Am . J . Math . It has the ISSN number `` 0002-9327 '' and comes under the discipline of Math .\n",
      "[['American Journal of Mathematics', 'academicDiscipline', 'Mathematics'],\n",
      " ['American Journal of Mathematics', 'firstPublicationYear', '1878'],\n",
      " ['American Journal of Mathematics', 'abbreviation', '``'],\n",
      " ['American Journal of Mathematics', 'ISSN_number', \"`` 0002-9327 ''\"]]\n",
      "The fried chicken dish Ayam penyet can be found all over Indonesia , Malaysia and Singapore . The chicken is `` squeezed '' or `` smashed '' and served with sambal .\n",
      "[['Ayam penyet', 'region', '``'],\n",
      " ['Ayam penyet', 'mainIngredients', '``'],\n",
      " ['Ayam penyet', 'country', 'Indonesia']]\n",
      "The fried chicken dish Ayam penyet can be found all over Indonesia , Malaysia and Singapore . The chicken is `` squeezed '' or `` smashed '' and served with sambal .\n",
      "[['Ayam penyet', 'region', '``'],\n",
      " ['Ayam penyet', 'mainIngredients', '``'],\n",
      " ['Ayam penyet', 'country', 'Indonesia']]\n",
      "Ayam penyet is a dish from the region of Singapore and Indonesia . The main ingredients of Ayam penyet are `` squeezed '' or `` smashed '' chicken served with sambal . It also has fried chicken in it .\n",
      "[['Ayam penyet', 'region', 'Singapore'],\n",
      " ['Ayam penyet', 'mainIngredients', '``'],\n",
      " ['Ayam penyet', 'country', 'Indonesia']]\n",
      "Batagor comes from the country of Indonesia . It is made using fried fish dumpling with tofu and vegetables in Peanut sauce and should be served `` hot '' .\n",
      "[['Batagor', 'country', 'Indonesia'],\n",
      " ['Batagor', 'ingredient', 'Peanut sauce'],\n",
      " ['Batagor', 'mainIngredients', '``'],\n",
      " ['Batagor', 'servingTemperature', \"`` hot ''\"]]\n",
      "Agra Airport , with the ICAO location identifier of `` VIAG '' , is located in Uttar Pradesh . The IATA I.D of the airport is AGR and the operating organisation is the Airports Authority of India .\n",
      "[['Agra Airport', 'location', 'Uttar Pradesh'],\n",
      " ['Agra Airport', 'IATA_Location_Identifier', '``'],\n",
      " ['Agra Airport', 'ICAO_Location_Identifier', \"`` VIAG ''\"],\n",
      " ['Agra Airport', 'operatingOrganisation', 'Airports Authority of India']]\n",
      "A.F.C . Blackpool 's has 1500 members and their ground is The Mechanics . A.F.C . Blackpool 's full name is `` Association Football Club Blackpool '' and they played in season 2014 .\n",
      "[['A.F.C . Blackpool', 'ground', '``'],\n",
      " ['A.F.C . Blackpool', 'season', '2014'],\n",
      " ['A.F.C . Blackpool', 'numberOfMembers', '1500'],\n",
      " ['A.F.C . Blackpool', 'fullname', \"`` Association Football Club Blackpool ''\"]]\n",
      "Agremiação Sportiva Arapiraquense 's full name is `` Agremiação Sportiva Arapiraquense '' although their nickname is Alvinegro . The club has 17000 members and were in Campeonato Brasileiro Serie C in 2015 .\n",
      "[['Agremiação Sportiva Arapiraquense', 'nickname', '``'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'numberOfMembers', '17000'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'season', '2015'],\n",
      " ['Agremiação Sportiva Arapiraquense',\n",
      "  'fullname',\n",
      "  \"`` Agremiação Sportiva Arapiraquense ''\"]]\n",
      "Agremiação Sportiva Arapiraquense ( which is the club 's full name ) played in the 2015 season . They have 17000 members and the nickname `` Alvinegro '' .\n",
      "[['Agremiação Sportiva Arapiraquense', 'nickname', '``'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'season', '2015'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'numberOfMembers', '17000'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'fullname', '``']]\n",
      "Agremiação Sportiva Arapiraquense ( which is the club 's full name ) played in the 2015 season . They have 17000 members and the nickname `` Alvinegro '' .\n",
      "[['Agremiação Sportiva Arapiraquense', 'nickname', '``'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'season', '2015'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'numberOfMembers', '17000'],\n",
      " ['Agremiação Sportiva Arapiraquense', 'fullname', '``']]\n",
      "Construction of Adisham Hall , Haputale , designed in the `` Tudor Revival '' style , began in 1927 and was finished in 1931 .\n",
      "[['Adisham Hall', 'architecturalStyle', 'Tudor Revival'],\n",
      " ['Adisham Hall', 'completionDate', '1931'],\n",
      " ['Adisham Hall', 'buildingStartDate', '``'],\n",
      " ['Adisham Hall', 'location', 'Haputale']]\n",
      "Asilomar Conference Grounds which are designed based on the architecture style of `` Arts and Crafts Movement and American craftsman Bungalows '' and have the reference number in the the National Register of Historic Places of 87000823 , were constructed in 1913 at Asilomar Blvd. , Pacific Grove , California .\n",
      "[['Asilomar Conference Grounds', 'location', '``'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'ReferenceNumber in the National Register of Historic Places',\n",
      "  '``'],\n",
      " ['Asilomar Conference Grounds', 'yearOfConstruction', '1913'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'architecture',\n",
      "  \"`` Arts and Crafts Movement and American craftsman Bungalows ''\"]]\n",
      "Asilomar Conference Grounds which are designed based on the architecture style of `` Arts and Crafts Movement and American craftsman Bungalows '' and have the reference number in the the National Register of Historic Places of 87000823 , were constructed in 1913 at Asilomar Blvd. , Pacific Grove , California .\n",
      "[['Asilomar Conference Grounds', 'location', '``'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'ReferenceNumber in the National Register of Historic Places',\n",
      "  '``'],\n",
      " ['Asilomar Conference Grounds', 'yearOfConstruction', '1913'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'architecture',\n",
      "  \"`` Arts and Crafts Movement and American craftsman Bungalows ''\"]]\n",
      "Asilomar Conference Grounds are located in Pacific Grove , California , was constructed in 1913 , has the reference number 87000823 in the National Register of Historic Places and architecturally is of the `` Arts and Crafts Movement and American Craftsman Bungalows '' .\n",
      "[['Asilomar Conference Grounds', 'location', 'Pacific Grove , California'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'ReferenceNumber in the National Register of Historic Places',\n",
      "  '``'],\n",
      " ['Asilomar Conference Grounds', 'yearOfConstruction', '1913'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'architecture',\n",
      "  '`` Arts and Crafts Movement and American']]\n",
      "Located in Pacific Grove , California , Asilomar Conference Grounds were constructed in 1913 , added to the National Register of Historic Places on 27nd February 1987 and is in the architectural style of the `` Arts and Crafts Movement and American Craftsman Bungalows '' .\n",
      "[['Asilomar Conference Grounds', 'location', 'Pacific Grove , California'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'added to the National Register of Historic Places',\n",
      "  '``'],\n",
      " ['Asilomar Conference Grounds', 'yearOfConstruction', '1913'],\n",
      " ['Asilomar Conference Grounds',\n",
      "  'architecture',\n",
      "  '`` Arts and Crafts Movement and American']]\n",
      "The rector of the 1 Decembrie 1918 University in the state of Alba , Romania is Breaz Valer Daniel . The latin name of the university is `` Universitas Apulensis '' .\n",
      "[['1 Decembrie 1918 University', 'rector', '``'],\n",
      " ['1 Decembrie 1918 University', 'latinName', \"`` Universitas Apulensis ''\"],\n",
      " ['1 Decembrie 1918 University', 'country', 'Romania'],\n",
      " ['1 Decembrie 1918 University', 'state', 'Alba']]\n",
      "The 1 Decembrie 1918 University is located in Alba Iulia , Alba , Romania . Its Latun name is `` Universitas Apulensis '' and its nickname is `` Uab '' . Its rectore is Breaz Valer Daniel .\n",
      "[['1 Decembrie 1918 University', 'nickname', 'Uab'],\n",
      " ['1 Decembrie 1918 University', 'rector', '``'],\n",
      " ['1 Decembrie 1918 University', 'city', 'Alba Iulia'],\n",
      " ['1 Decembrie 1918 University', 'latinName', \"`` Universitas Apulensis ''\"],\n",
      " ['1 Decembrie 1918 University', 'country', 'Romania'],\n",
      " ['1 Decembrie 1918 University', 'state', 'Alba']]\n",
      "The Acharya Institute of Technology 's campus is in Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore , India , 560090 . Its director is Dr G.P . Prabhukumar and its motto is `` Nurturing Excellence '' . It is affiliated with the Visvesvaraya Technological University .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'campus', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "The Acharya Institute of Technology 's campus is in Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore , India , 560090 . Its director is Dr G.P . Prabhukumar and its motto is `` Nurturing Excellence '' . It is affiliated with the Visvesvaraya Technological University .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'campus', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "The Acharya Institute of Technology 's campus is in Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore , India , 560090 . Its director is Dr G.P . Prabhukumar and its motto is `` Nurturing Excellence '' . It is affiliated with the Visvesvaraya Technological University .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'campus', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "1634 : The Bavarian Crisis , written by Virginia DeMarce and Eric Flint , can be located by it 's ISBN number `` 978-1-4165-4253-7 '' .\n",
      "[['1634 : The Bavarian Crisis', 'ISBN_number', \"`` 978-1-4165-4253-7 ''\"],\n",
      " ['1634 : The Bavarian Crisis', 'author', '``']]\n",
      "`` A Glastonbury Romance `` which has 1174 pages can be found in hardcover .\n",
      "[['A Glastonbury Romance', 'numberOfPages', '``']]\n",
      "The 388-page `` A Severed Wasp '' has an ISBN number of `` 0-374-26131-8 .\n",
      "[['A Severed Wasp', 'numberOfPages', '``'],\n",
      " ['A Severed Wasp', 'ISBN_number', '`` 0-374-26131-8']]\n",
      "`` Abh.Math.Semin.Univ.Hambg '' is the abbreviation for Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg and is concerned with the academic discipline of Pure Mathematics .\n",
      "[['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'academicDiscipline',\n",
      "  'Pure'],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'abbreviation',\n",
      "  '``']]\n",
      "Garth Nix is the author of `` Above the Veil , '' ISBN number 0-439-17685-9 .\n",
      "[['Above the Veil', 'author', 'Garth Nix'],\n",
      " ['Above the Veil', 'ISBN_number', '``']]\n",
      "Acta Palaeontologica Polonica ( abbreviated to Acta Palaeontol . Pol . ) has a CODEN code of `` APGPAC '' .\n",
      "[['Acta Palaeontologica Polonica', 'abbreviation', '``'],\n",
      " ['Acta Palaeontologica Polonica', 'CODEN_code', \"`` APGPAC ''\"]]\n",
      "Aenir is available in print and has the ISBN number of `` 0-439-17684-0 '' .\n",
      "[['Aenir', 'mediaType', '``'], ['Aenir', 'ISBN_number', \"`` 0-439-17684-0 ''\"]]\n",
      "The motto of the Acharya Institute of Technology is `` Nurturing Excellence '' and there is an academic staff of 500 .\n",
      "[['Acharya Institute of Technology', 'academicStaffSize', '``'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"]]\n",
      "The book `` A Fortress of Grey Ice '' can be found in print .\n",
      "[['A Fortress of Grey Ice', 'mediaType', '``']]\n",
      "The Library of Congress Classification of `` A Glastonbury Romance '' is PR6031 .0867 .\n",
      "[['A Glastonbury Romance', 'LibraryofCongressClassification', '``']]\n",
      "PS3523.E55 S4 1982 is the Library of Congress Classification of `` A Severed Wasp '' .\n",
      "[['A Severed Wasp', 'LibraryofCongressClassification', '``']]\n",
      "`` Abh.Math.Semin.Univ.Hambg '' is the abbreviation for Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg .\n",
      "[['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'abbreviation',\n",
      "  '``']]\n",
      "The book `` Alcatraz Versus the Evil Librarians is in print .\n",
      "[['Alcatraz Versus the Evil Librarians', 'mediaType', '``']]\n",
      "The main ingredients of Ayam penyet are `` squeezed '' or `` smashed '' chicken served with sambal .\n",
      "[['Ayam penyet', 'mainIngredients', '``']]\n",
      "Ayam Penyet is a Malaysian dish including the main ingredients of `` squeezed '' or `` smashed '' chicken served with sambal . The dish can be found in Java where the Banyumasan people are an ethnic group .\n",
      "[['Java', 'ethnicGroup', 'Banyumasan people'],\n",
      " ['Ayam', 'mainIngredients', '``'],\n",
      " ['Ayam', 'country', 'Java']]\n",
      "The Javanese people are an ethnic group of Java , where the food Ayam penyet can be found . The dish , which has the main ingredients `` squeezed '' or `` smashed '' fried chicken served with sambal , can be found nationwide and also in Malaysia and Singapore .\n",
      "[['Java', 'ethnicGroup', 'Javanese people'],\n",
      " ['Ayam penyet', 'mainIngredients', '``'],\n",
      " ['Ayam penyet', 'region', '``'],\n",
      " ['Ayam penyet', 'country', 'Java']]\n",
      "The Javanese people are an ethnic group of Java , where the food Ayam penyet can be found . The dish , which has the main ingredients `` squeezed '' or `` smashed '' fried chicken served with sambal , can be found nationwide and also in Malaysia and Singapore .\n",
      "[['Java', 'ethnicGroup', 'Javanese people'],\n",
      " ['Ayam penyet', 'mainIngredients', '``'],\n",
      " ['Ayam penyet', 'region', '``'],\n",
      " ['Ayam penyet', 'country', 'Java']]\n",
      "Acta Palaeontologica Polonica was published by the Polish Academy of Sciences and is abbreviated to Acta Palaeontol . Pol . . It is identified by the ISSN number of `` 1732-2421 '' and the LCCN number of 60040714 . It also has the CODEN code of `` APGPAC '' .\n",
      "[['Acta Palaeontologica Polonica', 'publisher', 'Polish Academy of Sciences'],\n",
      " ['Acta Palaeontologica Polonica', 'ISSN_number', \"`` 1732-2421 ''\"],\n",
      " ['Acta Palaeontologica Polonica', 'LCCN_number', '60040714'],\n",
      " ['Acta Palaeontologica Polonica', 'abbreviation', '``'],\n",
      " ['Acta Palaeontologica Polonica', 'CODEN_code', \"`` APGPAC ''\"]]\n",
      "In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 is the location of the Acharya Institute of Technology established in the state of Karnataka , India in the year 2000 . The Institute , whose motto is `` Nurturing Excellence '' is affiliated with the Visvesvaraya Technological University in the city of Belgaum .\n",
      "[['Visvesvaraya Technological University', 'city', 'Belgaum'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'campus', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 is the location of the Acharya Institute of Technology established in the state of Karnataka , India in the year 2000 . The Institute , whose motto is `` Nurturing Excellence '' is affiliated with the Visvesvaraya Technological University in the city of Belgaum .\n",
      "[['Visvesvaraya Technological University', 'city', 'Belgaum'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'campus', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "Ayam penyet , which is from Java , is a dish from the region of Singapore . The main ingredients of ayma penyet , of which fried chicken is one , are `` squeezed '' or `` smashed '' chicken served with sambal .\n",
      "[['Ayam penyet', 'region', 'Singapore'],\n",
      " ['Ayam penyet', 'country', 'Java'],\n",
      " ['Ayam penyet', 'mainIngredients', '``']]\n",
      "Jorge Humberto Rodríguez manages the A.D. Isidro Metapan , is located in Metapán , El Salvado , has 10000 members , and full name is `` Asociación Deportiva '' .\n",
      "[['A.D. Isidro', 'manager', 'Jorge Humberto Rodríguez'],\n",
      " ['A.D. Isidro', 'ground', '``'],\n",
      " ['A.D. Isidro', 'numberOfMembers', '10000'],\n",
      " ['A.D. Isidro', 'fullname', \"`` Asociación Deportiva ''\"]]\n",
      "Paul Gustavson is the creator of `` The Arrow '' , otherwise known as Ralph Payne .\n",
      "[['The Arrow', 'alternativeName', '``'],\n",
      " ['The Arrow', 'creator', 'Paul Gustavson']]\n",
      "Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg can be located by the ISSN number `` 0025-5858 '' and has the abbreviation Abh . Math . Semin . Univ . Hambg .\n",
      "[['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'ISSN_number',\n",
      "  \"`` 0025-5858 ''\"],\n",
      " ['Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg',\n",
      "  'abbreviation',\n",
      "  '``']]\n",
      "Alan B Miller Hall ( which was inaugurated on 2009-10-02 ) has the address `` 101 Ukrop Way '' .\n",
      "[['Alan', 'inaugurationDate', '``'], ['Alan', 'address', \"`` 101 Ukrop Way ''\"]]\n",
      "The `` Associazione Sportiva Roma S.p.A. '' is the non-abbreviated name of A.S. Roma which has 70634 members and a home ground in Rome , Italy .\n",
      "[['A.S. Roma', 'fullname', \"`` Associazione Sportiva Roma S.p.A. ''\"],\n",
      " ['A.S. Roma', 'ground', '``'],\n",
      " ['A.S. Roma', 'numberOfMembers', '70634']]\n",
      "Angola International Airport is located at Ícolo e Bengo in Angola and the runway is named `` south runway '' .\n",
      "[['Angola International Airport', 'location', 'Ícolo e Bengo'],\n",
      " ['Ícolo e Bengo', 'country', 'Angola'],\n",
      " ['Angola International Airport', 'runwayName', '``']]\n",
      "The Acharya Institute of Technology is located in Bangalore , India and its motto is : `` Nurturing Excellence '' .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``']]\n",
      "1634 : The Bavarian Crisis can be located by it 's ISBN number `` 978-1-4165-4253-7 '' . It is written by Virginia DeMarce and Eric Flint and was put in print .\n",
      "[['1634 : The Bavarian Crisis', 'ISBN_number', \"`` 978-1-4165-4253-7 ''\"],\n",
      " ['1634 : The Bavarian Crisis', 'author', '``'],\n",
      " ['1634 : The Bavarian Crisis', 'mediaType', '``']]\n",
      "1634 : The Bavarian Crisis can be located by it 's ISBN number `` 978-1-4165-4253-7 '' . It is written by Virginia DeMarce and Eric Flint and was put in print .\n",
      "[['1634 : The Bavarian Crisis', 'ISBN_number', \"`` 978-1-4165-4253-7 ''\"],\n",
      " ['1634 : The Bavarian Crisis', 'author', '``'],\n",
      " ['1634 : The Bavarian Crisis', 'mediaType', '``']]\n",
      "A Severed Wasp has an ISBN number of `` 0-374-26131-8 '' , 388 pages and can be found in print .\n",
      "[['A Severed Wasp', 'numberOfPages', '``'],\n",
      " ['A Severed Wasp', 'mediaType', '``'],\n",
      " ['A Severed Wasp', 'ISBN_number', \"`` 0-374-26131-8 ''\"]]\n",
      "A Severed Wasp has an ISBN number of `` 0-374-26131-8 '' , 388 pages and can be found in print .\n",
      "[['A Severed Wasp', 'numberOfPages', '``'],\n",
      " ['A Severed Wasp', 'mediaType', '``'],\n",
      " ['A Severed Wasp', 'ISBN_number', \"`` 0-374-26131-8 ''\"]]\n",
      "The Acta Mathematica Hungarica ISSN number is `` 0236-5294 '' and the abbreviation is Acta Math . Hungar . It comes under the academic discipline of Math .\n",
      "[['Acta Mathematica Hungarica', 'abbreviation', '``'],\n",
      " ['Acta Mathematica Hungarica', 'ISSN_number', \"`` 0236-5294 ''\"]]\n",
      "Addiction is the abbreviated version of the `` Addiction Journal '' which has the ISSN number 0965-2140 .\n",
      "[['Addiction', 'academicDiscipline', 'Addiction'],\n",
      " ['Addiction', 'abbreviation', '`` Addiction'],\n",
      " ['Addiction', 'ISSN_number', '``']]\n",
      "Aenir has the ISBN number of `` 0-439-17684-0 '' , it was written by Garth Nix and was produced in print .\n",
      "[['Aenir', 'author', 'Garth Nix'],\n",
      " ['Aenir', 'mediaType', '``'],\n",
      " ['Aenir', 'ISBN_number', \"`` 0-439-17684-0 ''\"]]\n",
      "In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 is the location of the Acharya Institute of Technology in India which is affiliated with the Visvesvaraya Technological University . The motto of the Institute which was established in the year 2000 is `` Nurturing Excellence '' and there are 700 postgraduate students .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'numberOfPostgraduateStudents', '700'],\n",
      " ['Acharya Institute of Technology', 'campus', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 is the location of the Acharya Institute of Technology in India which is affiliated with the Visvesvaraya Technological University . The motto of the Institute which was established in the year 2000 is `` Nurturing Excellence '' and there are 700 postgraduate students .\n",
      "[['Acharya Institute of Technology', 'city', 'Bangalore'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'motto', \"`` Nurturing Excellence ''\"],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology', 'numberOfPostgraduateStudents', '700'],\n",
      " ['Acharya Institute of Technology', 'campus', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "In the year 2000 the Acharya Institute of Technology was established in the state of Karnataka , India . The current location is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Director is Dr G P Prabhukumar and it is affiliated with the Visvesvaraya Technological University in the city of Belgaum .\n",
      "[['Visvesvaraya Technological University', 'city', 'Belgaum'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "In the year 2000 the Acharya Institute of Technology was established in the state of Karnataka , India . The current location is `` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , Hessarghatta Main Road , Bangalore – 560090 . '' The Director is Dr G P Prabhukumar and it is affiliated with the Visvesvaraya Technological University in the city of Belgaum .\n",
      "[['Visvesvaraya Technological University', 'city', 'Belgaum'],\n",
      " ['Acharya Institute of Technology', 'director', '``'],\n",
      " ['Acharya Institute of Technology', 'established', '2000'],\n",
      " ['Acharya Institute of Technology', 'state', 'Karnataka'],\n",
      " ['Acharya Institute of Technology', 'country', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'campus',\n",
      "  '`` In Soldevanahalli , Acharya Dr. Sarvapalli Radhakrishnan Road , '\n",
      "  'Hessarghatta Main Road , Bangalore – 560090 .'],\n",
      " ['Acharya Institute of Technology',\n",
      "  'affiliation',\n",
      "  'Visvesvaraya Technological University']]\n",
      "A Severed Wasp was published in hardback and has 388 pages . The OCLC number of A Severed Wasp is 8805735 and the ISBN number of `` 0-374-26131-8 '' .\n",
      "[['A Severed Wasp', 'numberOfPages', '``'],\n",
      " ['A Severed Wasp', 'OCLC_number', '8805735'],\n",
      " ['A Severed Wasp', 'ISBN_number', \"`` 0-374-26131-8 ''\"]]\n",
      "The Addiction journal UNK the UNK of Addiction and has the LCCN number 93645978 . The abbreviated name is `` Addiction '' and the ISSN number is 1360-0443 .\n",
      "[['Addiction', 'academicDiscipline', 'Addiction'],\n",
      " ['Addiction', 'LCCN_number', '93645978'],\n",
      " ['Addiction', 'abbreviation', \"`` Addiction ''\"],\n",
      " ['Addiction', 'ISSN_number', '``']]\n",
      "The Administrative Science Quarterly has a Coden code of `` ASCQAG '' and the abbreviation of Admin.Sci.Q .\n",
      "[['Administrative Science Quarterly', 'CODEN_code', \"`` ASCQAG ''\"],\n",
      " ['Administrative Science Quarterly', 'abbreviation', '``']]\n",
      "Ayam penyet is a food found in Java and the main ingredients are `` squeezed '' or `` smashed '' chicken served with sambal .\n",
      "[['Ayam penyet', 'country', 'Java'], ['Ayam penyet', 'mainIngredients', '``']]\n",
      "The All India Council for Technical Education UNK the Acharya Institute of Technology the status of `` Technical Campus '' . The official school colours are blue , white and orange .\n",
      "[['Acharya Institute of Technology', 'officialSchoolColour', '``'],\n",
      " ['Acharya Institute of Technology',\n",
      "  \"was given the 'Technical Campus' status by\",\n",
      "  'All India Council for Technical Education']]\n"
     ]
    }
   ],
   "source": [
    "# bad_samples = []\n",
    "# for sample in train_data + valid_data + test_data:\n",
    "#      for spo in sample[\"spo_list\"]:\n",
    "#         if spo[0] == \"``\" or spo[2] == \"``\":\n",
    "#             bad_samples.append(bad_samples)\n",
    "#             print(\" \".join(sample[\"tokens\"]))\n",
    "#             pprint(sample[\"spo_list\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Raw NYT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "nyt_data_dir = \"../ori_data/nyt\"\n",
    "nyt_train_data_path = os.path.join(nyt_data_dir, \"raw_train.json\")\n",
    "nyt_valid_data_path = os.path.join(nyt_data_dir, \"raw_valid.json\")\n",
    "nyt_test_data_path = os.path.join(nyt_data_dir, \"raw_test.json\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data(path):\n",
    "    with open(path, \"r\", encoding = \"utf-8\") as file:\n",
    "        data = [json.loads(line) for line in file]\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "nyt_train_data = get_data(nyt_train_data_path)\n",
    "nyt_valid_data = get_data(nyt_valid_data_path)\n",
    "nyt_test_data = get_data(nyt_test_data_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def remove_stress_mark(text):\n",
    "    text = \"\".join([c for c in unicodedata.normalize(\"NFD\", text) if unicodedata.category(c) != \"Mn\"])\n",
    "    return text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 66196/66196 [00:01<00:00, 48675.62it/s]\n"
     ]
    }
   ],
   "source": [
    "for sample in tqdm(nyt_train_data + nyt_valid_data + nyt_test_data):\n",
    "    # remove stress marks\n",
    "    for rel in sample[\"relationMentions\"]:\n",
    "        rel[\"em1Text\"] = remove_stress_mark(rel[\"em1Text\"])\n",
    "        rel[\"em2Text\"] = remove_stress_mark(rel[\"em2Text\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 66196/66196 [00:00<00:00, 549415.74it/s]\n"
     ]
    }
   ],
   "source": [
    "# fix a bad sample\n",
    "for sample in tqdm(nyt_train_data + nyt_valid_data + nyt_test_data):\n",
    "    if \"XXXXXXXXXX\" in sample[\"sentText\"]:\n",
    "        sample[\"sentText\"] = re.sub(\"X+\", \"\", sample[\"sentText\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Output to Disk\n",
    "train_data_path = os.path.join(nyt_data_dir, \"train_data.json\")\n",
    "valid_data_path = os.path.join(nyt_data_dir, \"valid_data.json\")\n",
    "test_data_dir = os.path.join(nyt_data_dir, \"test_data\")\n",
    "if not os.path.exists(test_data_dir):\n",
    "    os.mkdir(test_data_dir)\n",
    "test_data_path = os.path.join(test_data_dir, \"test_data.json\")\n",
    "\n",
    "json.dump(nyt_train_data, open(train_data_path, \"w\", encoding = \"utf-8\"), ensure_ascii = False)\n",
    "json.dump(nyt_valid_data, open(valid_data_path, \"w\", encoding = \"utf-8\"), ensure_ascii = False)\n",
    "json.dump(nyt_test_data, open(test_data_path, \"w\", encoding = \"utf-8\"), ensure_ascii = False)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
